﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Mvc;
using UserCenter.Admin.Models;
using UserCenter.BLL;

namespace UserCenter.Admin.Controllers
{
    public class MemberController : Controller
    {
        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="nickName">昵称</param>
        /// <param name="avaterBase64">头像Base64</param>
        /// <returns>会员Id</returns>
        public JsonResult Register(string nickName, string avaterBase64)
        {
           // MemberBLL.Create()
            return Json(0);
        }


        /// <summary>
        /// 设置会员扩展数据
        /// </summary>
        /// <param name="memberId">会员Id</param>
        /// <param name="jsonData">会员json数据</param>
        /// <returns>是否成功</returns>
        public JsonResult SetExt(long memberId, string jsonData)
        {
            return Json(false);
        }

        /// <summary>
        /// 设置会员的上级
        /// </summary>
        /// <param name="memberId">会员Id</param>
        /// <param name="parents">上级的会员Id列表</param>
        /// <returns></returns>
        public JsonResult SetParents(long memberId, List<long> parents)
        {
            return Json(false);
        }


        /// <summary>
        /// 设置会员的角色
        /// </summary>
        /// <param name="memberId">会员Id</param>
        /// <param name="roles">角色Id列表</param>
        /// <returns></returns>
        public JsonResult SetRole(long memberId, List<int> roles)
        {
            return Json(false);
        }


        /// <summary>
        /// 设置会员密码
        /// </summary>
        /// <param name="type">密码类型</param>
        /// <param name="memberId">会员Id</param>
        /// <param name="seed">验证种子</param>
        /// <param name="password">一次MD5后的密码</param>
        /// <returns></returns>
        public JsonResult SetPassword(int type, long memberId, string seed, string password)
        {
            return Json(false);
        }

        /// <summary>
        /// 获取授权
        /// </summary>
        /// <param name="type">密码类型</param>
        /// <param name="seed">验证种子</param>
        /// <param name="password">一次MD5后的密码</param>
        /// <returns>登录结果</returns>
        public JsonResult Authorization(int type, string seed, string password)
        {
            return Json(new AuthorizationResult());
        }



        /// <summary>
        /// 验证Token
        /// </summary>
        /// <param name="seed">验证种子</param>
        /// <param name="password">一次MD5后的密码</param>
        /// <returns>返回会员Id</returns>
        public JsonResult CheckToken(string seed, string password)
        {
            return Json(0);
        }




    }
}
